# 验证代码修复情况
Write-Host "🔍 验证ArkTS代码修复..." -ForegroundColor Cyan

$localCacheFile = "localcache/src/main/ets/cache/LocalCacheManager.ets"

if (Test-Path $localCacheFile) {
    $content = Get-Content $localCacheFile -Raw
    
    Write-Host "\n📋 检查结果:" -ForegroundColor Yellow
    
    # 检查Record类型
    if ($content -match "Record<") {
        Write-Host "❌ 仍然存在Record类型使用" -ForegroundColor Red
    } else {
        Write-Host "✅ 已移除所有Record类型使用" -ForegroundColor Green
    }
    
    # 检查索引签名
    if ($content -match "\[.*:.*\]") {
        Write-Host "❌ 仍然存在索引签名语法" -ForegroundColor Red
    } else {
        Write-Host "✅ 已移除所有索引签名语法" -ForegroundColor Green
    }
    
    # 检查可选属性
    if ($content -match "error\?:") {
        Write-Host "❌ 仍然存在可选error属性" -ForegroundColor Red
    } else {
        Write-Host "✅ 已修复所有可选error属性" -ForegroundColor Green
    }
    
    # 检查any类型
    if ($content -match "\bany\b") {
        Write-Host "❌ 仍然存在any类型使用" -ForegroundColor Red
    } else {
        Write-Host "✅ 未发现any类型使用" -ForegroundColor Green
    }
    
    Write-Host "\n📊 统计信息:" -ForegroundColor Yellow
    $lines = ($content -split "\n").Count
    Write-Host "📄 总行数: $lines" -ForegroundColor White
    
    $classCount = ($content | Select-String "class " -AllMatches).Matches.Count
    Write-Host "🏗️ 类定义数量: $classCount" -ForegroundColor White
    
    $loggerCalls = ($content | Select-String "Logger\.(debug|info|warn|error)" -AllMatches).Matches.Count
    Write-Host "📝 Logger调用数量: $loggerCalls" -ForegroundColor White
    
} else {
    Write-Host "❌ 找不到LocalCacheManager.ets文件" -ForegroundColor Red
}

Write-Host "\n✨ 验证完成！" -ForegroundColor Cyan
Write-Host "📝 建议在DevEco Studio中进行完整构建测试" -ForegroundColor Yellow